﻿using System;

public class ResultEntity
{
    private int _sheetItemsID;
    private int _studentEvalID;
    private int _teacherID;

    public ResultEntity()
    {
    }

    public ResultEntity(int sheetItemsID, int studentEvalID, int teacherID)
    {
        _sheetItemsID = sheetItemsID;
        _studentEvalID = studentEvalID;
        _teacherID = teacherID;
    }

    public int SheetItemsID
    {
        get { return _sheetItemsID; }
        set { _sheetItemsID = value; }
    }

    public int StudentEvalID
    {
        get { return _studentEvalID; }
        set { _studentEvalID = value; }
    }

    public int TeacherID
    {
        get { return _teacherID; }
        set { _teacherID = value; }
    }

    public bool Equals(ResultEntity other)
    {
        if (ReferenceEquals(null, other)) return false;
        if (ReferenceEquals(this, other)) return true;
        return other._sheetItemsID == _sheetItemsID && other._studentEvalID == _studentEvalID && other._teacherID == _teacherID;
    }

    public override bool Equals(object obj)
    {
        if (ReferenceEquals(null, obj)) return false;
        if (ReferenceEquals(this, obj)) return true;
        if (obj.GetType() != typeof (ResultEntity)) return false;
        return Equals((ResultEntity) obj);
    }

    public override int GetHashCode()
    {
        unchecked
        {
            int result = _sheetItemsID;
            result = (result*397) ^ _studentEvalID;
            result = (result*397) ^ _teacherID;
            return result;
        }
    }
}
